package com.ruoyi.user.mapper;

import com.ruoyi.user.domain.UserAnnouncement;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 公告Mapper接口
 */
public interface UserAnnouncementMapper {
    /**
     * 查询公告
     */
    UserAnnouncement selectUserAnnouncementById(Long announcementId);

    /**
     * 查询公告列表
     */
    List<UserAnnouncement> selectUserAnnouncementList(UserAnnouncement userAnnouncement);

    /**
     * 查询用户可见的公告列表
     */
    List<UserAnnouncement> selectUserAnnouncements(@Param("customerId") Long customerId,
                                             @Param("regionId") Long regionId);

    /**
     * 新增公告
     */
    int insertUserAnnouncement(UserAnnouncement userAnnouncement);

    /**
     * 修改公告
     */
    int updateUserAnnouncement(UserAnnouncement userAnnouncement);

    /**
     * 删除公告
     */
    int deleteUserAnnouncementById(Long announcementId);

    /**
     * 批量删除公告
     */
    int deleteUserAnnouncementByIds(Long[] announcementIds);

    /**
     * 查询用户未读公告数量
     */
    int selectUnreadUserAnnouncementCount(@Param("customerId") Long customerId,
                                     @Param("regionId") Long regionId);
}